package com.ym.b2b.order.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ym.b2b.order.dao.WebServiceOrderDao;
import com.ym.b2b.order.service.WebServiceOrderService;
import com.ym.b2b.order.sqlbean.WebServiceOrder;

/**
 * @ClassName: WebServiceOrderServiceImpl
 * @Author cym
 * @Date 2016年9月22日 下午4:30:09
 * @CopyRight 珍诚医药在线股份有限公司
 */

@Service
public class WebServiceOrderServiceImpl implements WebServiceOrderService {
    @Autowired
    private WebServiceOrderDao		dao;
    
	@Override
	public List<WebServiceOrder> getOrderList(WebServiceOrder order)throws Exception {
		
		List<WebServiceOrder> list = dao.getOrderList(order);
		// 查询订单明细
		for (WebServiceOrder orderItem : list) {
			orderItem.setList(dao.getOrderItemList(orderItem));
		}
		return list;
	}

	@Override
	public int updateOrder(WebServiceOrder order) throws Exception {
		return dao.updateOrder(order);
	}

	@Override
	public int updateOrderItemForOos(WebServiceOrder order) throws Exception {
		return dao.updateOrderItemForOos(order);
	}

}
